# 新增成员
# 导包
import requests
import conftest
from common.get_md5_password import get_md5
from utils.get05_register_data import Register

class Test_addUser():

    def setup_method(self):
        # 定义登录接口URL地址
        self.addUser_url = "http://192.168.3.182:9990/airservice-user/org/addUser"
        self.username = Register.get_username()

    # case01  新增不存在的用户
    def test_addUser_case01(self):
        self.password="wsf1234"
        self.addUser_data = {"oid": 29,
                             "account":self.username,
                             "password": get_md5(self.password),
                             "type": 2 }

        response = requests.post(url=self.addUser_url, json=self.addUser_data, headers=conftest.headers_data)
        #print(response.json())
        #print(self.addUser_data["password"])
        #添加断言
        assert response.json().get("message") == "操作成功"
        assert  response.json().get("success") == True